package com.sdhs.paas.sdk.core.jdbc.pool;


import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.SQLFeatureNotSupportedException;
import java.util.Properties;
import java.util.logging.Logger;

import javax.management.MBeanServer;
import javax.management.ObjectName;
import javax.sql.PooledConnection;

import org.apache.tomcat.jdbc.pool.DataSource;
import org.apache.tomcat.jdbc.pool.PoolProperties.InterceptorDefinition;
import org.apache.tomcat.jdbc.pool.Validator;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * tomcat datasource 静态代理
 *
 * @author wjj
 *
 */
public class PaasDS {
	@Autowired
	DataSource tomcatDS;

	public DataSource getTomcatDS() {
		return tomcatDS;
	}

	public void setTomcatDS(DataSource tomcatDS) {
		this.tomcatDS = tomcatDS;
	}

	
	public PrintWriter getLogWriter() throws SQLException {
		return tomcatDS.getLogWriter();
	}

	
	public void setLogWriter(PrintWriter out) throws SQLException {
		tomcatDS.setLogWriter(out);

	}

	
	public void setLoginTimeout(int seconds) {
		tomcatDS.setLoginTimeout(seconds);

	}

	
	public int getLoginTimeout() {
		return tomcatDS.getLoginTimeout();
	}

	
	public Logger getParentLogger() throws SQLFeatureNotSupportedException {
		return tomcatDS.getParentLogger();
	}

	
	public <T> T unwrap(Class<T> iface) throws SQLException {
		return tomcatDS.unwrap(iface);
	}

	
	public boolean isWrapperFor(Class<?> iface) throws SQLException {
		return tomcatDS.isWrapperFor(iface);
	}

	
	public PooledConnection getPooledConnection() throws SQLException {
		return tomcatDS.getPooledConnection();
	}

	
	public PooledConnection getPooledConnection(String user, String paasword) throws SQLException {
		return tomcatDS.getPooledConnection(user, paasword);
	}

	
	public int getSize() {

		return tomcatDS.getSize();
	}

	
	public int getIdle() {

		return tomcatDS.getIdle();
	}

	
	public int getActive() {

		return tomcatDS.getActive();
	}

	
	public int getNumIdle() {

		return tomcatDS.getActive();
	}

	
	public int getNumActive() {

		return tomcatDS.getNumActive();
	}

	
	public int getWaitCount() {

		return tomcatDS.getWaitCount();
	}

	
	public long getBorrowedCount() {

		return tomcatDS.getBorrowedCount();
	}

	
	public long getReturnedCount() {

		return tomcatDS.getReturnedCount();
	}

	
	public long getCreatedCount() {

		return tomcatDS.getCreatedCount();
	}

	
	public long getReleasedCount() {

		return tomcatDS.getReleasedCount();
	}

	
	public long getReconnectedCount() {

		return tomcatDS.getReconnectedCount();
	}

	
	public long getRemoveAbandonedCount() {

		return tomcatDS.getRemoveAbandonedCount();
	}

	
	public long getReleasedIdleCount() {

		return tomcatDS.getReleasedIdleCount();
	}

	
	public void checkIdle() {

		tomcatDS.checkIdle();
	}

	
	public void checkAbandoned() {
		tomcatDS.checkAbandoned();

	}

	
	public void testIdle() {
		tomcatDS.testIdle();

	}

	
	public void purge() {
		tomcatDS.purge();

	}

	
	public void purgeOnReturn() {
		tomcatDS.purgeOnReturn();

	}

	
	public void resetStats() {

		tomcatDS.resetStats();
	}

	
	public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception {

		return tomcatDS.preRegister(server, name);
	}

	
	public void postRegister(Boolean registrationDone) {

		tomcatDS.postRegister(registrationDone);
	}

	
	public void preDeregister() throws Exception {
		tomcatDS.preDeregister();

	}

	
	public void postDeregister() {

		tomcatDS.postDeregister();
	}

	
	public Connection getConnection() throws SQLException {

		return tomcatDS.getConnection();
	}

	
	public Connection getConnection(String username, String paasword) throws SQLException {

		return tomcatDS.getConnection(username, paasword);
	}

	
	public void setAbandonWhenPercentageFull(int percentage) {

		tomcatDS.setAbandonWhenPercentageFull(percentage);
	}

	
	public int getAbandonWhenPercentageFull() {

		return tomcatDS.getAbandonWhenPercentageFull();
	}

	
	public boolean isFairQueue() {

		return tomcatDS.isFairQueue();
	}

	
	public void setFairQueue(boolean fairQueue) {

		tomcatDS.setFairQueue(fairQueue);
	}

	
	public boolean isAccessToUnderlyingConnectionAllowed() {

		return tomcatDS.isAccessToUnderlyingConnectionAllowed();
	}

	
	public void setAccessToUnderlyingConnectionAllowed(boolean accessToUnderlyingConnectionAllowed) {
		tomcatDS.setAccessToUnderlyingConnectionAllowed(accessToUnderlyingConnectionAllowed);

	}

	
	public String getConnectionProperties() {

		return tomcatDS.getConnectionProperties();
	}

	
	public void setConnectionProperties(String connectionProperties) {

		tomcatDS.setConnectionProperties(connectionProperties);
	}

	
	public Properties getDbProperties() {

		return tomcatDS.getDbProperties();
	}

	
	public void setDbProperties(Properties dbProperties) {
		tomcatDS.setDbProperties(dbProperties);

	}

	
	public Boolean isDefaultAutoCommit() {

		return tomcatDS.isDefaultAutoCommit();
	}

	
	public Boolean getDefaultAutoCommit() {

		return tomcatDS.getDefaultAutoCommit();
	}

	
	public void setDefaultAutoCommit(Boolean defaultAutoCommit) {

		tomcatDS.setDefaultAutoCommit(defaultAutoCommit);
	}

	
	public String getDefaultCatalog() {

		return tomcatDS.getDefaultCatalog();
	}

	
	public void setDefaultCatalog(String defaultCatalog) {

		tomcatDS.setDefaultCatalog(defaultCatalog);
	}

	
	public Boolean isDefaultReadOnly() {

		return tomcatDS.isDefaultReadOnly();
	}

	
	public Boolean getDefaultReadOnly() {

		return tomcatDS.getDefaultReadOnly();
	}

	
	public void setDefaultReadOnly(Boolean defaultReadOnly) {

		tomcatDS.setDefaultReadOnly(defaultReadOnly);
	}

	
	public int getDefaultTransactionIsolation() {

		return tomcatDS.getDefaultTransactionIsolation();
	}

	
	public void setDefaultTransactionIsolation(int defaultTransactionIsolation) {

		tomcatDS.setDefaultTransactionIsolation(defaultTransactionIsolation);
	}

	
	public String getDriverClassName() {

		return tomcatDS.getDriverClassName();
	}

	
	public void setDriverClassName(String driverClassName) {

		tomcatDS.setDriverClassName(driverClassName);
	}

	
	public int getInitialSize() {

		return tomcatDS.getInitialSize();
	}

	
	public void setInitialSize(int initialSize) {

		tomcatDS.setInitialSize(initialSize);
	}

	
	public boolean isLogAbandoned() {

		return tomcatDS.isLogAbandoned();
	}

	
	public void setLogAbandoned(boolean logAbandoned) {

		tomcatDS.setLogAbandoned(logAbandoned);
	}

	
	public int getMaxActive() {

		return tomcatDS.getMaxActive();
	}

	
	public void setMaxActive(int maxActive) {
		tomcatDS.setMaxActive(maxActive);

	}

	
	public int getMaxIdle() {

		return tomcatDS.getMaxIdle();
	}

	
	public void setMaxIdle(int maxIdle) {
		tomcatDS.setMaxIdle(maxIdle);

	}

	
	public int getMaxWait() {

		return tomcatDS.getMaxWait();
	}

	
	public void setMaxWait(int maxWait) {

		tomcatDS.setMaxWait(maxWait);
	}

	
	public int getMinEvictableIdleTimeMillis() {

		return tomcatDS.getMinEvictableIdleTimeMillis();
	}

	
	public void setMinEvictableIdleTimeMillis(int minEvictableIdleTimeMillis) {

		tomcatDS.setMinEvictableIdleTimeMillis(minEvictableIdleTimeMillis);
	}

	
	public int getMinIdle() {

		return tomcatDS.getMinIdle();
	}

	
	public void setMinIdle(int minIdle) {
		tomcatDS.setMinIdle(minIdle);

	}

	
	public String getName() {

		return tomcatDS.getName();
	}

	
	public void setName(String name) {
		tomcatDS.setName(name);

	}

	
	public int getNumTestsPerEvictionRun() {

		return tomcatDS.getNumTestsPerEvictionRun();
	}

	
	public void setNumTestsPerEvictionRun(int numTestsPerEvictionRun) {

		tomcatDS.setNumTestsPerEvictionRun(numTestsPerEvictionRun);
	}

	
	public String getpaasword() {

		return tomcatDS.getPassword();
	}

	
	public void setpaasword(String paasword) {

		tomcatDS.setPassword(paasword);
	}

	
	public String getPoolName() {

		return tomcatDS.getPoolName();
	}

	
	public String getUsername() {

		return tomcatDS.getUsername();
	}

	
	public void setUsername(String username) {

		tomcatDS.setUsername(username);
	}

	
	public boolean isRemoveAbandoned() {

		return tomcatDS.isRemoveAbandoned();
	}

	
	public void setRemoveAbandoned(boolean removeAbandoned) {

		tomcatDS.setRemoveAbandoned(removeAbandoned);
	}

	
	public void setRemoveAbandonedTimeout(int removeAbandonedTimeout) {

		tomcatDS.setRemoveAbandonedTimeout(removeAbandonedTimeout);
	}

	
	public int getRemoveAbandonedTimeout() {

		return tomcatDS.getRemoveAbandonedTimeout();
	}

	
	public boolean isTestOnBorrow() {

		return tomcatDS.isTestOnBorrow();
	}

	
	public void setTestOnBorrow(boolean testOnBorrow) {
		tomcatDS.setTestOnBorrow(testOnBorrow);

	}

	
	public boolean isTestOnReturn() {

		return tomcatDS.isTestOnReturn();
	}

	
	public void setTestOnReturn(boolean testOnReturn) {
		tomcatDS.setTestOnReturn(testOnReturn);

	}

	
	public boolean isTestWhileIdle() {

		return tomcatDS.isTestWhileIdle();
	}

	
	public void setTestWhileIdle(boolean testWhileIdle) {

		tomcatDS.setTestWhileIdle(testWhileIdle);
	}

	
	public int getTimeBetweenEvictionRunsMillis() {

		return tomcatDS.getTimeBetweenEvictionRunsMillis();
	}

	
	public void setTimeBetweenEvictionRunsMillis(int timeBetweenEvictionRunsMillis) {

		tomcatDS.setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRunsMillis);
	}

	
	public String getUrl() {

		return tomcatDS.getUrl();
	}

	
	public void setUrl(String url) {

		tomcatDS.setUrl(url);
	}

	
	public String getValidationQuery() {

		return tomcatDS.getValidationQuery();
	}

	
	public void setValidationQuery(String validationQuery) {
		tomcatDS.setValidationQuery(validationQuery);

	}

	
	public int getValidationQueryTimeout() {

		return tomcatDS.getValidationQueryTimeout();
	}

	
	public void setValidationQueryTimeout(int validationQueryTimeout) {

		tomcatDS.setValidationQueryTimeout(validationQueryTimeout);
	}

	
	public String getValidatorClassName() {

		return tomcatDS.getValidatorClassName();
	}

	
	public void setValidatorClassName(String className) {

		tomcatDS.setValidatorClassName(className);
	}

	
	public Validator getValidator() {

		return tomcatDS.getValidator();
	}

	
	public void setValidator(Validator validator) {
		tomcatDS.setValidator(validator);

	}

	
	public long getValidationInterval() {

		return tomcatDS.getValidationInterval();
	}

	
	public void setValidationInterval(long validationInterval) {
		tomcatDS.setValidationInterval(validationInterval);

	}

	
	public String getInitSQL() {

		return tomcatDS.getInitSQL();
	}

	
	public void setInitSQL(String initSQL) {
		tomcatDS.setInitSQL(initSQL);

	}

	
	public boolean isTestOnConnect() {

		return tomcatDS.isTestOnConnect();
	}

	
	public void setTestOnConnect(boolean testOnConnect) {
		tomcatDS.setTestOnConnect(testOnConnect);

	}

	
	public String getJdbcInterceptors() {

		return tomcatDS.getJdbcInterceptors();
	}

	
	public void setJdbcInterceptors(String jdbcInterceptors) {
		tomcatDS.setJdbcInterceptors(jdbcInterceptors);

	}

	
	public InterceptorDefinition[] getJdbcInterceptorsAsArray() {

		return tomcatDS.getJdbcInterceptorsAsArray();
	}

	
	public boolean isJmxEnabled() {

		return tomcatDS.isJmxEnabled();
	}

	
	public void setJmxEnabled(boolean jmxEnabled) {

		tomcatDS.setJmxEnabled(jmxEnabled);
	}

	
	public boolean isPoolSweeperEnabled() {

		return tomcatDS.isPoolSweeperEnabled();
	}

	
	public boolean isUseEquals() {

		return tomcatDS.isUseEquals();
	}

	
	public void setUseEquals(boolean useEquals) {

		tomcatDS.setUseEquals(useEquals);
	}

	
	public long getMaxAge() {

		return tomcatDS.getMaxAge();
	}

	
	public void setMaxAge(long maxAge) {
		tomcatDS.setMaxAge(maxAge);

	}

	
	public boolean getUseLock() {

		return tomcatDS.getUseLock();
	}

	
	public void setUseLock(boolean useLock) {

		tomcatDS.setUseLock(useLock);
	}

	
	public void setSuspectTimeout(int seconds) {
		tomcatDS.setSuspectTimeout(seconds);

	}

	
	public int getSuspectTimeout() {

		return tomcatDS.getSuspectTimeout();
	}

	
	public void setDataSource(Object ds) {
		tomcatDS.setDataSource(ds);

	}

	
	public Object getDataSource() {

		return tomcatDS.getDataSource();
	}

	
	public void setDataSourceJNDI(String jndiDS) {

		tomcatDS.setDataSourceJNDI(jndiDS);
	}

	
	public String getDataSourceJNDI() {

		return tomcatDS.getDataSourceJNDI();
	}

	
	public boolean isAlternateUsernameAllowed() {

		return tomcatDS.isAlternateUsernameAllowed();
	}

	
	public void setAlternateUsernameAllowed(boolean alternateUsernameAllowed) {
		tomcatDS.setAlternateUsernameAllowed(alternateUsernameAllowed);

	}

	
	public void setCommitOnReturn(boolean commitOnReturn) {

		tomcatDS.setCommitOnReturn(commitOnReturn);
	}

	
	public boolean getCommitOnReturn() {

		return tomcatDS.getCommitOnReturn();
	}

	
	public void setRollbackOnReturn(boolean rollbackOnReturn) {

		tomcatDS.setRollbackOnReturn(rollbackOnReturn);
	}

	
	public boolean getRollbackOnReturn() {

		return tomcatDS.getRollbackOnReturn();
	}

	
	public void setUseDisposableConnectionFacade(boolean useDisposableConnectionFacade) {

		tomcatDS.setUseDisposableConnectionFacade(useDisposableConnectionFacade);
	}

	
	public boolean getUseDisposableConnectionFacade() {

		return tomcatDS.getUseDisposableConnectionFacade();
	}

	
	public void setLogValidationErrors(boolean logValidationErrors) {
		tomcatDS.setLogValidationErrors(logValidationErrors);

	}

	
	public boolean getLogValidationErrors() {

		return tomcatDS.getLogValidationErrors();
	}

	
	public boolean getPropagateInterruptState() {

		return tomcatDS.getPropagateInterruptState();
	}

	
	public void setPropagateInterruptState(boolean propagateInterruptState) {
		tomcatDS.setPropagateInterruptState(propagateInterruptState);

	}

	
	public void setIgnoreExceptionOnPreLoad(boolean ignoreExceptionOnPreLoad) {
		tomcatDS.setIgnoreExceptionOnPreLoad(ignoreExceptionOnPreLoad);

	}

	
	public boolean isIgnoreExceptionOnPreLoad() {

		return tomcatDS.isIgnoreExceptionOnPreLoad();
	}

	
	public void setUseStatementFacade(boolean useStatementFacade) {

		tomcatDS.setUseStatementFacade(useStatementFacade);
	}

	
	public boolean getUseStatementFacade() {

		return tomcatDS.getUseDisposableConnectionFacade();
	}

}
